﻿using CPF;
using CPF.Controls;
using System;
using System.Collections.Generic;
using System.Text;

namespace CPFManager
{
    [CPF.Design.DesignerLoadStyle("res://CPFManager/Stylesheet1.css")]
    public class OperationCellTemplate : DataGridCellTemplate
    {
        protected override void InitializeComponent()
        {
            Classes = "DataGridCell";
            BorderType = BorderType.BorderThickness;
            BorderThickness = new Thickness(0, 0, 1, 0);
            if (IsRootInDesignMode)
            {
                Width = "100";
                Height = "30";
            }
            else
            {
                Width = "100%";
                Height = "100%";
            }
            Children.Add(new Button
            {
                Classes = "primary",
                Width = 38,
                MarginLeft = 4,
                Content = "设置"
            });
            Children.Add(new Button
            {
                Width = 35,
                MarginLeft = 56,
                Content = "删除"
            });
            Commands.Add(nameof(MouseDown), (s, e) =>
            {
                Focus();
            });
        }
    }
}
